﻿Imports System
Imports System.IO
Imports System.Runtime.Serialization
Imports System.Runtime.Serialization.Formatters.Binary
''' <summary>
''' 某一种污染物，不同的平均时间的浓度。根据用户选择的时间不同，设置不同的时间平均浓度。
''' </summary>
''' <remarks></remarks>
<Serializable()> Public Class AverageTimeCon
    Private m_PollutionName As String
    Private m_Con1 As Double
    Private m_Con2 As Double
    Private m_Con3 As Double
    Private m_Con4 As Double
    Private m_Con6 As Double
    Private m_Con8 As Double
    Private m_Con12 As Double
    Private m_Con24 As Double
    Private m_ConMonth As Double
    Private m_ConPeriod As Double
    ''' <summary>
    ''' 1小时浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Con1() As Double
        Get
            Return Me.m_Con1
        End Get
        Set(ByVal value As Double)
            Me.m_Con1 = value
        End Set
    End Property
    ''' <summary>
    ''' 2小时浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Con2() As Double
        Get
            Return Me.m_Con2
        End Get
        Set(ByVal value As Double)
            Me.m_Con2 = value
        End Set
    End Property
    ''' <summary>
    ''' 3小时浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Con3() As Double
        Get
            Return Me.m_Con3
        End Get
        Set(ByVal value As Double)
            Me.m_Con3 = value
        End Set
    End Property
    ''' <summary>
    ''' 4小时浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Con4() As Double
        Get
            Return Me.m_Con4
        End Get
        Set(ByVal value As Double)
            Me.m_Con4 = value
        End Set
    End Property
    ''' <summary>
    ''' 6小时浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Con6() As Double
        Get
            Return Me.m_Con6
        End Get
        Set(ByVal value As Double)
            Me.m_Con6 = value
        End Set
    End Property
    ''' <summary>
    ''' 8小时浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Con8() As Double
        Get
            Return Me.m_Con8
        End Get
        Set(ByVal value As Double)
            Me.m_Con8 = value
        End Set
    End Property
    ''' <summary>
    ''' 12小时浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Con12() As Double
        Get
            Return Me.m_Con12
        End Get
        Set(ByVal value As Double)
            Me.m_Con12 = value
        End Set
    End Property
    Property Con24() As Double
        Get
            Return Me.m_Con24
        End Get
        Set(ByVal value As Double)
            Me.m_Con24 = value
        End Set
    End Property
    ''' <summary>
    ''' 月小时浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property ConMonth() As Double
        Get
            Return Me.m_ConMonth
        End Get
        Set(ByVal value As Double)
            Me.m_ConMonth = value
        End Set
    End Property
    ''' <summary>
    ''' 年平均浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property ConPeriod() As Double
        Get
            Return Me.m_ConPeriod
        End Get
        Set(ByVal value As Double)
            Me.m_ConPeriod = value
        End Set
    End Property
    ''' <summary>
    ''' 污染物的名称
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property PollutionName() As String
        Get
            Return Me.m_PollutionName
        End Get
        Set(ByVal value As String)
            Me.m_PollutionName = value
        End Set
    End Property
    ''' <summary>
    ''' 设置某一点的污染物浓度
    ''' </summary>
    ''' <param name="AverageTime">平均时间</param>
    ''' <param name="ConValue">浓度值</param>
    ''' <remarks></remarks>
    Public Sub SetPollution(ByVal AverageTime As String, ByVal ConValue As Double)
        Select Case AverageTime
            Case "1小时"
                m_Con1 = ConValue
            Case "2小时"
                m_Con2 = ConValue
            Case "3小时"
                m_Con3 = ConValue
            Case "4小时"
                m_Con4 = ConValue
            Case "6小时"
                m_Con6 = ConValue
            Case "8小时"
                m_Con8 = ConValue
            Case "12小时"
                m_Con12 = ConValue
            Case "24小时"
                m_Con24 = ConValue
            Case "月平均"
                m_ConMonth = ConValue
            Case "期间平均"
                m_ConPeriod = ConValue
        End Select
    End Sub
    ''' <summary>
    ''' 获取背景浓度
    ''' </summary>
    ''' <param name="AverageTime">平均时间</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function GetPollution(ByVal AverageTime As String) As Double
        Select Case AverageTime
            Case "1小时"
                Return m_Con1
            Case "2小时"
                Return m_Con2
            Case "3小时"
                Return m_Con3
            Case "4小时"
                Return m_Con4
            Case "6小时"
                Return m_Con6
            Case "8小时"
                Return m_Con8
            Case "12小时"
                Return m_Con12
            Case "24小时"
                Return m_Con24
            Case "月平均"
                Return m_ConMonth
            Case "期间平均"
                Return m_ConPeriod
        End Select
        Return Nothing
    End Function
End Class
